<?php get_instance()->view('common/header');?>
<style type="text/css">
    <!--
    .text-val {
        padding-top: 3px;
        padding-left: 0;
    }

    .text-label {
        color: grey;
        text-align: right;
    }

    .btn-group, .btn-group-vertical {
        display: inline-block;
        position: absolute;
        vertical-align: middle;
    }

    .sale-summary li:first-child {
        border-top: medium none;
    }

    .sale-summary li {
        border-top: 1px solid #eee;
        overflow: hidden;
        padding: 10px 0;
    }

    .sale-summary li .sale-info {
        color: #646464;
        float: left;
        font-size: 14px;
        text-transform: uppercase;
    }

    .sale-summary li .sale-num {
        color: #169ef4;
        float: right;
        font-size: 20px;
        font-weight: 300;
    }

    .description-box img {
        width: 100%;
    }
    .img{max-width: 300px;max-height: 300px}
    img{max-width: 100%;max-height: 100%;}
</style>
<style type="text/css">
    div .radio-inline:nth-child(2), div .checkbox-inline:nth-child(2) {
        margin-left: 10px;
    }
    .table-scrollable > .table > thead > tr > th, .table-scrollable > .table > tbody > tr > th, .table-scrollable > .table > tfoot > tr > th, .table-scrollable > .table > thead > tr > td, .table-scrollable > .table > tbody > tr > td, .table-scrollable > .table > tfoot > tr > td{
        word-break:break-all;
    }
    .sup-portrait>img{max-width: 100%;height: 100px;}
    .table-actions-wrapper{float: right}
    .upgrade{margin: 10px;}
    .help-block{display: inline}
    .webuploader-container > div:nth-child(2){top: 4px !important;left: 4px !important;width: 100px !important;height: 104px !important;}
    #uploader-ads-demo .thumbnail{width: 110px;height: 110px;}
</style>
<div class="page-container home">
    <?php get_instance()->view('common/sidebar');?>
    <div class="page-content-wrapper">
        <div class="page-content">
            <div class="row">
                <div class="col-md-12">
                    <!-- BEGIN PAGE TITLE & BREADCRUMB-->
                    <h3 class="page-title"><?php echo $title?></h3>
                    <ul class="page-breadcrumb breadcrumb">
                        <li class="btn-group"> <a class="btn default ml_5 return" href="<?php echo getUrl('member/merchant');?>"><i class="fa fa-chevron-left"></i> 返回</a> </li>
                        <li><i class="fa fa-home"></i><a href="<?php echo getUrl('course');?>"><?php echo $title?>  <i class="fa fa-angle-right"></i></a></li>
                        <li><a href="javascript:void(0);">详情</a></li>
                    </ul>
                    <!-- END PAGE TITLE & BREADCRUMB-->
                </div>
            </div>
            <div class="row">
                <div class="col-md-12">
                    <div class="row">
                        <div class="col-md-12 profile-info">
                            <div class="row">
                                <div class="col-md-12">
                                    <div style="border: 1px solid #ddd; padding: 10px; margin-bottom: 30px;">
                                        <div class="row">
                                            <div class="col-md-1">
                                                <ul class="list-unstyled profile-nav">
                                                    <li><img width="100%" src="<?php echo $info['portrait'] ? $info['portrait'] : getDefaultPortrait(2)?>" class="img-responsive" alt=""></li>
                                                </ul>
                                            </div>
                                            <div class="col-md-11">
                                                <div class="row">
                                                    <div class="col-md-6">
                                                        <div class="form-group">
                                                            <label class="col-md-4 control-label text-label">店铺名称：</label>
                                                            <div class="col-md-8 text-val nickname"><?php echo $info['shop_name'];?></div>
                                                        </div>
                                                    </div>
                                                    <div class="col-md-6">
                                                        <div class="form-group">
                                                            <label class="col-md-4 control-label text-label">手机号码：</label>
                                                            <div class="col-md-8 text-val"><?php echo $info['mobile'];?></div>
                                                        </div>
                                                    </div>
                                                    <div class="col-md-6">
                                                        <div class="form-group">
                                                            <label class="col-md-4 control-label text-label">余额：</label>
                                                            <div class="col-md-8 text-val balance"><?php echo $info['balance'];?></div>
                                                        </div>
                                                    </div>
                                                    <div class="col-md-6">
                                                        <div class="form-group">
                                                            <label class="col-md-4 control-label text-label">状态：</label>
                                                            <div class="col-md-8 text-val"><?php echo $info['status']==1 ? '禁用' : '启用';?></div>
                                                        </div>
                                                    </div>
                                                    <div class="col-md-6 hide">
                                                        <div class="form-group">
                                                            <label class="col-md-4 control-label text-label">等级：</label>
                                                            <div class="col-md-8 text-val">
                                                                <span class="rank_name"><?php echo $info['rank_name']?></span>
                                                                <a href="javascript:;" class="upgrade">调整</a>
                                                                <a href="javascript:;" class="reason" data-id="<?php echo $info['id']?>">查看记录</a>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="col-md-6">
                                                        <div class="form-group">
                                                            <label class="col-md-4 control-label text-label">注册时间：</label>
                                                            <div class="col-md-8 text-val"><?php echo dateFormat($info['addtime']);?></div>
                                                        </div>
                                                    </div>
                                                    <?php if ($info['rank'] == 3):?>
<!--                                                    <div class="col-md-6">-->
<!--                                                        <div class="form-group">-->
<!--                                                            <label class="col-md-4 control-label text-label">店铺视频：</label>-->
<!--                                                            <div class="col-md-8 text-val"><a href="--><?php //echo $info['shop_video'];?><!--" target="_blank">--><?php //echo $info['shop_video'];?><!--</a></div>-->
<!--                                                        </div>-->
<!--                                                    </div>-->
                                                    <?php endif;?>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!--end col-md-8-->
                    </div>
                    <!--end row-->
                    <div class="tabbable tabbable-custom tabbable-custom-profile">
                        <ul class="nav nav-tabs">
                            <?php if (empty($shopInfo) || (!empty($shopInfo) && $shopInfo['status'] != 3)):?>
                                <li class="active"><a href="#tab_1_1" data-toggle="tab"> 店铺配置 </a></li>
                                <li><a href="#tab_1_2" data-toggle="tab"> 订单列表 </a></li>
                                <li><a href="#tab_1_3" data-toggle="tab"> 售后列表 </a></li>
                                <li><a href="#tab_1_4" data-toggle="tab"> 评价列表 </a></li>
                                <li><a href="#tab_1_5" data-toggle="tab"> 商品列表 </a></li>
                                <li><a href="#tab_1_6" data-toggle="tab"> 商品分类 </a></li>
                                <li><a href="#tab_1_7" data-toggle="tab"> 资金明细 </a></li>
<!--                                <li><a href="#tab_1_8" data-toggle="tab"> 红包投放 </a></li>-->
                                <li><a href="#tab_1_9" data-toggle="tab"> 代金券投放 </a></li>
                                <li><a href="#tab_1_10" data-toggle="tab"> 满减规则 </a></li>
<!--                                <li><a href="#tab_1_11" data-toggle="tab"> 广告投放 </a></li>-->
                                <li><a href="#tab_1_12" data-toggle="tab"> 银行卡(支付宝) </a></li>
                                <li><a href="#tab_1_13" data-toggle="tab">店铺环境/广告</a></li>
                            <?php endif;?>
                            <?php if (!empty($shopInfo)):?>
                                <li <?php if ($shopInfo['status'] == 3): ?> class="active" <?php endif;?>><a href="#tab_1_14" data-toggle="tab">认证信息</a></li>
                            <?php endif;?>
                        </ul>
                        <div class="tab-content">
                            <?php if (empty($shopInfo) || (!empty($shopInfo) && $shopInfo['status'] != 3)):?>
                            <!--店铺信息-->
                            <div class="active tab-pane" id="tab_1_1">
                                <div class="row ">
                                    <div class="col-md-12">
                                        <!-- BEGIN VALIDATION STATES-->
                                        <div class="portlet box">
                                            <div class="portlet-body form">
                                                <form action="<?php echo getUrl('member/merchant/saveStore')?>" class="form-horizontal" method="post" id="main-form2" novalidate="novalidate">
                                                    <div class="form-body">
                                                        <div class="row ">
                                                            <div class="col-md-6">
                                                                <div class="form-group">
                                                                    <label class="control-label col-md-4">店铺名称<span class="required">*</span></label>
                                                                    <div class="col-md-8">
                                                                        <input class="form-control required"  name="shop_name" type="text" value="<?php echo isset($info['shop_name']) ? $info['shop_name'] : '';?>" >
                                                                    </div>
                                                                </div>
                                                                <div class="form-group">
                                                                    <label class="control-label col-md-4">店铺电话<span class="required">*</span></label>
                                                                    <div class="col-md-8">
                                                                        <input class="form-control required"  name="store_tel" type="text" value="<?php echo isset($info['store_tel']) ? $info['store_tel'] : '';?>" >
                                                                    </div>
                                                                </div>
                                                                <div class="form-group">
                                                                    <label class="control-label col-md-4">起送金额<span class="required">*</span></label>
                                                                    <div class="col-md-8">
                                                                        <input class="form-control required number"  name="min_consume" type="text" value="<?php echo isset($info['min_consume']) ? $info['min_consume'] : '';?>" >
                                                                    </div>
                                                                </div>
                                                                <div class="form-group">
                                                                    <label class="control-label col-md-4">周营业日<span class="required">*</span></label>
                                                                    <div class="col-md-8">
                                                                        <select class="form-control sel required" multiple name="week[]" data-placeholder="请选择">
                                                                            <?php foreach ($week as $k=>$v): ?>
                                                                                <?php  if(isset($info['business_week']) && in_array($k,$info['business_week'])): ?>
                                                                                    <option value="<?php echo $k?>" selected ><?php echo $v?></option>
                                                                                <?php else: ?>
                                                                                    <option value="<?php echo $k?>" ><?php echo $v?></option>
                                                                                <?php endif;?>
                                                                            <?php endforeach;?>
                                                                        </select>
                                                                    </div>
                                                                </div>
                                                                <script type="text/javascript">
                                                                    $(function () {
                                                                        $(".sel").select2();
                                                                    });
                                                                </script>
<!--                                                                <div class="form-group">-->
<!--                                                                    <label class="control-label col-md-4">日营业时<span class="required">*</span></label>-->
<!--                                                                    <div class="col-md-4">-->
<!--                                                                        <input type="text" class="form-control timepicker timepicker-24" name="business_time_start" value="--><?php //echo isset($info['business_time_start']) ? $info['business_time_start'] : '08:00';?><!--">-->
<!--                                                                        <span class="help-block msg">填写示例:08:00-21:00</span>-->
<!--                                                                    </div>-->
<!--                                                                    <div class="col-md-4">-->
<!--                                                                        <input type="text" class="form-control timepicker timepicker-24" name="business_time_end" value="--><?php //echo isset($info['business_time_end']) ? $info['business_time_end'] : '21:00';?><!--">-->
<!--                                                                    </div>-->
<!---->
<!--                                                                    <script type="text/javascript">-->
<!--                                                                        $(function () {-->
<!--                                                                            $('.timepicker-24').timepicker({-->
<!--                                                                                autoclose: true,-->
<!--                                                                                minuteStep: 3,-->
<!--                                                                                showSeconds: false,-->
<!--                                                                                showMeridian: false-->
<!--                                                                            });-->
<!--                                                                            $(".bootstrap-timepicker-hour").attr('readonly');-->
<!--                                                                            $(".bootstrap-timepicker-minute").attr('readonly');-->
<!--                                                                        })-->
<!--                                                                    </script>-->
<!--                                                                </div>-->
                                                                <div class="form-group">
                                                                    <label class="control-label col-md-4">首单减免金额<span class="required">*</span></label>
                                                                    <div class="col-md-8">
                                                                        <input class="form-control required"  name="first_order_reduce" type="text" value="<?php echo isset($info['first_order_reduce']) ? $info['first_order_reduce'] : '';?>" >
                                                                    </div>
                                                                </div>
                                                                <div class="form-group">
                                                                    <label class="control-label col-md-4">平台比例（百分比）<span class="required">*</span></label>
                                                                    <div class="col-md-8">
                                                                        <input class="form-control required number"  name="percent" type="text" value="<?php echo isset($info['percent']) ? $info['percent'] : 0;?>" >
                                                                    </div>
                                                                </div>
                                                                <div class="form-group">
                                                                    <label class="control-label col-md-4">保底抽成<span class="required">*</span></label>
                                                                    <div class="col-md-8">
                                                                        <input class="form-control required number"  name="min_order_web_amount" type="text" value="<?php echo isset($info['min_order_web_amount']) ? $info['min_order_web_amount'] : 0;?>" >
                                                                    </div>
                                                                </div>
                                                                <div class="form-group">
                                                                    <label class="control-label col-md-4">预计送达时间（分钟）<span class="required">*</span></label>
                                                                    <div class="col-md-8">
                                                                        <input class="form-control required number"  name="expect_arrive_time" type="text" value="<?php echo isset($info['expect_arrive_time']) ? $info['expect_arrive_time'] : 0;?>" >
                                                                    </div>
                                                                </div>
                                                                <div class="form-group">
                                                                    <label class="control-label col-md-4">是否启用代金券<span class="required">*</span></label>
                                                                    <div class="col-md-8" style="margin-left: -3px;">
                                                                        <div class="radio-list">
                                                                            <label class="radio-inline"><input name="able_cash_coupon" <?php if( $info['able_cash_coupon'] == 1):?> checked<?php endif;?>  value="1" type="radio" > 禁用 </label>
                                                                            <label class="radio-inline" style="padding-left: 30px"><input name="able_cash_coupon" <?php if( $info['able_cash_coupon'] == 2):?> checked<?php endif;?>  value="2" type="radio"> 启用 </label>

                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="form-group hide">
                                                                    <label class="control-label col-md-4">诚信商家<span class="required">*</span></label>
                                                                    <div class="col-md-8" style="margin-left: -3px;">
                                                                        <div class="radio-list">
                                                                            <label class="radio-inline"><input name="honest" <?php if( $info['honest'] == 1):?> checked<?php endif;?>  value="1" type="radio" > 普通商户 </label>
                                                                            <label class="radio-inline" style="padding-left: 2px"><input name="honest" <?php if( $info['honest'] == 2):?> checked<?php endif;?>  value="2" type="radio"> 诚信商户 </label>
                                                                        </div>
                                                                    </div>
                                                                </div>
        <!--                                                        <div class="form-group">-->
        <!--                                                            <label class="control-label col-md-4">是否支持使用红包<span class="required">*</span></label>-->
        <!--                                                            <div class="col-md-8" style="margin-left: 18px;">-->
        <!--                                                                <div class="radio-list">-->
        <!--                                                                    <label class="radio-inline"><input name="able_use_coupon" --><?php //if( $info['able_use_coupon'] == 1):?><!-- checked--><?php //endif;?><!--  value="1" type="radio" > 禁用 </label>-->
        <!--                                                                    <label class="radio-inline" style="padding-left: 20px"><input name="able_use_coupon" --><?php //if( $info['able_use_coupon'] == 2):?><!-- checked--><?php //endif;?><!--  value="2" type="radio"> 启用 </label>-->
        <!---->
        <!--                                                                </div>-->
        <!--                                                            </div>-->
        <!--                                                        </div>-->
                                                                <input name="able_use_coupon"   value="2" type="hidden">
                                                                <div class="form-group">
                                                                    <label class="control-label col-md-4">营业状态<span class="required">*</span></label>
                                                                    <div class="col-md-8" style="margin-left: -3px;">
                                                                        <div class="radio-list">
                                                                            <label class="radio-inline"><input name="business" <?php if( $info['business'] == 1):?> checked<?php endif;?>  value="1" type="radio" > 休息 </label>
                                                                            <label class="radio-inline" style="padding-left: 30px"><input name="business" <?php if( $info['business'] == 2):?> checked<?php endif;?>  value="2" type="radio"> 营业 </label>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="form-group">
                                                                    <label class="control-label col-md-4">配送类型<span class="required">*</span></label>
                                                                    <div class="col-md-8" style="margin-left: -3px;">
                                                                        <div class="radio-list">
                                                                            <label class="radio-inline"><input name="shipping_type" <?php if( $info['shipping_type'] == 1):?> checked<?php endif;?>  value="1" type="radio" > 商家配送 </label>
                                                                            <label class="radio-inline" style="padding-left: 2px"><input name="shipping_type" <?php if( $info['shipping_type'] == 2):?> checked<?php endif;?>  value="2" type="radio"> 平台配送 </label>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="col-md-6">
                                                                <div class="form-group">
                                                                    <label class="control-label col-md-12" style="text-align: left;">
                                                                        多时间段营业<span class="required">*</span>
                                                                        <a href="javascript:;" class="btn btn-sm business-btn">
                                                                            <img src="<?php echo $this->staticUrl;?>img/4.png" alt="" style="margin-bottom: 2px;">
                                                                            添加
                                                                        </a>
                                                                        <span class="help-block msg">填写示例:08:00-21:00，温馨提示:结束时间必须大于开始时间，不可以交叉设置时间</span>
                                                                    </label>
                                                                </div>
                                                                <div class="business-box" index="0">
                                                                    <?php $i = 0;  if (empty($business)):?>
                                                                        <div class="form-group business">
                                                                            <div class="col-md-5">
                                                                                <input type="text" class="form-control timepicker timepicker-24 start" name="businessTime[0][start]" value="">
                                                                            </div>
                                                                            <div class="col-md-5">
                                                                                <input type="text" class="form-control timepicker timepicker-24 end" name="businessTime[0][end]" value="">
                                                                            </div>
                                                                        </div>
                                                                    <?php else: foreach ($business as $k => $v):?>
                                                                        <div class="form-group business">
                                                                            <div class="col-md-5">
                                                                                <input type="text" class="form-control timepicker timepicker-24 start" name="businessTime[<?php echo $i?>][start]" value="<?php echo isset($v['business_time_start']) ? $v['business_time_start'] : '';?>">
                                                                            </div>
                                                                            <div class="col-md-5">
                                                                                <input type="text" class="form-control timepicker timepicker-24 end" name="businessTime[<?php echo $i?>][end]" value="<?php echo isset($v['business_time_end']) ? $v['business_time_end'] : '';?>">
                                                                            </div>
                                                                            <?php if ($i > 0):?>
                                                                                <div class="col-md-2">
                                                                                    <a href="javascript:void(0);" class="delete-business-btn">
                                                                                        <img src="<?php echo $this->staticUrl;?>img/2.png" alt="">
                                                                                    </a>
                                                                                </div>
                                                                            <?php endif;?>
                                                                        </div>
                                                                        <?php $i +=1; endforeach; endif;?>
                                                                </div>
                                                                <script type="text/javascript">
                                                                    $(function () {
                                                                        $('.timepicker-24').timepicker({
                                                                            autoclose: true,
                                                                            minuteStep: 3,
                                                                            showSeconds: false,
                                                                            showMeridian: false
                                                                        });
                                                                        $(".bootstrap-timepicker-hour").attr('readonly');
                                                                        $(".bootstrap-timepicker-minute").attr('readonly');

                                                                        var modal = $('.business-box');
                                                                        modal.attr('index', <?php echo $i?>);
                                                                        $('.business-btn').click(function(){
                                                                            var M = modal.find('.business');
                                                                            var len = M.length;
                                                                            var b = M.eq(len - 1);
                                                                            if (len >= 5){
                                                                                show_message({status: 0, message: '最多不超过5个设置'});
                                                                                return false;
                                                                            }
                                                                            if (len > 0) {
                                                                                var s = b.find('.start').val();
                                                                                var e = b.find('.end').val();
                                                                                if (!s.length || !e.length) {
                                                                                    show_message({status: 0, message: '请完成上一个时间段的填写'});
                                                                                    return false;
                                                                                }
                                                                            }
                                                                            var i = modal.attr('index');
                                                                            i = parseInt(i)+1;
                                                                            modal.attr('index', i);
                                                                            var business_name = "businessTime["+i+"]";
                                                                            var deleteImg = "<?php echo $this->staticUrl;?>img/2.png";
                                                                            var html =
                                                                                '<div class="form-group business">'+
                                                                                    '<div class="col-md-5">'+
                                                                                        '<input type="text" class="form-control timepicker timepicker-24 start" name="'+business_name+'[start]" value="<?php echo isset($info['business_time_start']) ? $info['business_time_start'] : '08:00';?>">'+
                                                                                    '</div>'+
                                                                                    '<div class="col-md-5">'+
                                                                                        '<input type="text" class="form-control timepicker timepicker-24 end" name="'+business_name+'[end]" value="<?php echo isset($info['business_time_end']) ? $info['business_time_end'] : '21:00';?>">'+
                                                                                    '</div>'+
                                                                                    '<div class="col-md-2">'+
                                                                                        '<a href="javascript:void(0);" class="delete-business-btn">'+
                                                                                            '<img src="'+deleteImg+'" alt="">'+
                                                                                        '</a>'+
                                                                                    '</div>'+
                                                                                '</div>';
                                                                            var obj = $(html);
                                                                            modal.append(obj);
                                                                            obj.focus();
                                                                            $('.timepicker-24').timepicker({
                                                                                autoclose: true,
                                                                                minuteStep: 3,
                                                                                showSeconds: false,
                                                                                showMeridian: false
                                                                            });
                                                                        });

                                                                        modal.find('.delete-business-btn').live('click', function(){
                                                                            $(this).parents('.business').remove();
                                                                        });
                                                                    })
                                                                </script>
                                                            </div>
                                                            <div class="form-actionsc fluid">
                                                                <div class="col-md-offset-2 col-md-9" style="padding-left: 0;">
                                                                    <input type="hidden" name="merchant_id" value="<?php echo get('id')?>">
                                                                    <button class="btn green"><i class="fa fa-save"></i> 保存</button>
                                                                    <a class="btn default seach-btn" href="<?php echo getUrl('member/merchant');?>"><i class="fa fa-chevron-left"></i> 返回</a>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </form>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <!--订单列表-->
                            <div class="tab-pane" id="tab_1_2">
                                <div class="table-responsive">
                                    <div class="table-container">
                                        <table class="table table-bordered table-hover" id="datatable_order">
                                            <thead>
                                            <tr role="row" class="heading">
                                                <th width="20%">编号</th>
                                                <th width="10%"> 会员名称</th>
                                                <th width="10%">消费模式</th>
                                                <th width="10%">订单金额</th>
                                                <th width="10%">实付金额</th>
                                                <th width="10%">支付方式</th>
                                                <th width="10%">下单时间 </th>
                                                <th width="10%">状态</th>
                                                <th width="10%">操作</th>
                                            </tr>
                                            <tr>
                                                <th><input class="form-control form-filter input-sm" name="orderCode" type="text"></th>
                                                <th>
                                                    <input class="form-control form-filter input-sm" name="consumer" placeholder="" type="text">
                                                </th>
                                                <th>
                                                    <select name="expenseType" class="form-control form-filter input-sm">
                                                        <option value="" selected="selected">所有</option>
                                                        <?php foreach ($expenseType as $k => $v):?>
                                                            <option value="<?php echo $k;?>"><?php echo $v;?></option>
                                                        <?php endforeach;?>
                                                    </select>
                                                </th>
                                                <th>
                                                    <div class="margin-bottom-5">
                                                        <input class="form-control form-filter input-sm" name="amount_from" placeholder="大于等于" type="text">
                                                    </div>
                                                    <input class="form-control form-filter input-sm" name="amount_to" placeholder="小于等于" type="text" ></th>
                                                </th>
                                                <th>
                                                    <div class="margin-bottom-5">
                                                        <input class="form-control form-filter input-sm" name="reality_amount_from" placeholder="大于等于" type="text">
                                                    </div>
                                                    <input class="form-control form-filter input-sm" name="reality_amount_to" placeholder="小于等于" type="text" ></th>
                                                </th>
                                                <th>
                                                    <select name="payType" class="form-control form-filter input-sm">
                                                        <option value="" selected="selected">所有</option>
                                                        <?php foreach ($payType as $k => $v):?>
                                                            <option value="<?php echo $k+1;?>"><?php echo $v;?></option>
                                                        <?php endforeach;?>
                                                    </select>
                                                </th>
                                                <th>
                                                    <div class="margin-bottom-5">
                                                        <input class="form-control form-filter input-sm" name="add_time_from" dp placeholder="大于等于" type="text">
                                                    </div>
                                                    <input class="form-control form-filter input-sm" name="add_time_to" dp placeholder="小于等于" type="text" ></th>
                                                </th>
                                                <th>
                                                    <select name="orderStatus" class="form-control form-filter input-sm">
                                                        <option value="" selected="selected">所有</option>
                                                        <?php foreach ($status as $k => $v):?>
                                                            <option value="<?php echo $k;?>"><?php echo $v;?></option>
                                                        <?php endforeach;?>
                                                    </select>
                                                </th>
                                                <th>
                                                    <div class="btn-group">
                                                        <a class="btn btn-xs filter-submit btn-default"><i class="fa fa-search"></i> 搜索</a>
                                                        <button data-toggle="dropdown" class="btn btn-default dropdown-toggle btn-xs" type="button"><i class="fa fa-angle-down"></i></button>
                                                        <ul role="menu" class="dropdown-menu pull-right">
                                                            <li><a href="javascript:void(0);" class="filter-cancel">重置</a></li>
                                                        </ul>
                                                    </div>
                                                </th>
                                            </tr>
                                            </thead>
                                            <tbody></tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>

                            <!--售后列表-->
                            <div class="tab-pane" id="tab_1_3">
                                <div class="table-responsive">
                                    <div class="table-container">
                                        <table class="table table-bordered table-hover" id="datatable_service">
                                            <thead>
                                            <tr role="row" class="heading">
                                                <th width="15%">订单号</th>
                                                <th width="15%">所属单号</th>
                                                <th width="20%">退款商品</th>
                                                <th width="10%">退款原因</th>
                                                <th width="10%">退款金额</th>
                                                <th width="10%">申请时间</th>
                                                <th width="10%">状态</th>
                                                <th width="10%">操作</th>
                                            </tr>
                                            <tr>
                                                <th><input class="form-control form-filter input-sm" name="serviceCode" type="text"></th>
                                                <th><input class="form-control form-filter input-sm" name="orCode" placeholder="" type="text"></th>
                                                <th><input class="form-control form-filter input-sm" name="productName" placeholder="" type="text"></th>
                                                <th></th>
                                                <th></th>
                                                <th>
                                                    <div class="margin-bottom-5">
                                                        <input class="form-control form-filter input-sm" name="service_add_time_from" dp placeholder="大于等于" type="text">
                                                    </div>
                                                    <input class="form-control form-filter input-sm" name="service_add_time_to" dp placeholder="小于等于" type="text" ></th>
                                                </th>
                                                <th>
                                                    <select name="serviceType" class="form-control form-filter input-sm">
                                                        <option value="" selected="selected">所有</option>
                                                        <?php foreach ($serviceType as $k => $v):?>
                                                            <option value="<?php echo $k;?>"><?php echo $v;?></option>
                                                        <?php endforeach;?>
                                                    </select>
                                                </th>
                                                <th>
                                                    <div class="btn-group">
                                                        <a class="btn btn-xs filter-submit btn-default"><i class="fa fa-search"></i> 搜索</a>
                                                        <button data-toggle="dropdown" class="btn btn-default dropdown-toggle btn-xs" type="button"><i class="fa fa-angle-down"></i></button>
                                                        <ul role="menu" class="dropdown-menu pull-right">
                                                            <li><a href="javascript:void(0);" class="filter-cancel">重置</a></li>
                                                        </ul>
                                                    </div>
                                                </th>
                                            </tr>
                                            </thead>
                                            <tbody></tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>

                            <!--评价列表-->
                            <div class="tab-pane" id="tab_1_4">
                                <div class="table-responsive">
                                    <div class="table-container">
                                        <table class="table table-bordered table-hover" id="datatable">
                                            <thead>
                                            <tr role="row" class="heading">
                                                <th width="20%"> 产品名称</th>
                                                <th width="20%"> 评论内容</th>
                                                <th width="7%"> 评分</th>
                                                <th width="8%"> 评论人</th>
                                                <th width="10%"> 商家回复</th>
                                                <th width="10%"> 平台回复</th>
                                                <th width="10%"> 评论时间 </th>
                                                <th width="15%"> 操作 </th>
                                            </tr>
                                            <tr>
                                                <th></th>
                                                <th></th>
                                                <th><input class="form-control form-filter input-sm" name="score" type="text"></th>
                                                <th><input class="form-control form-filter input-sm" name="c_name" type="text"></th>
                                                <th></th>
                                                <th></th>
                                                <th>
                                                    <div class="margin-bottom-5">
                                                        <input class="form-control form-filter input-sm" name="send_date_from" dp placeholder="大于等于" type="text">
                                                    </div>
                                                    <input class="form-control form-filter input-sm" name="send_date_to" dp placeholder="小于等于" type="text">
                                                </th>
                                                <th>
                                                    <div class="btn-group">
                                                        <a class="btn btn-xs filter-submit btn-default"><i class="fa fa-search"></i> 搜索</a>
                                                        <button data-toggle="dropdown" class="btn btn-default dropdown-toggle btn-xs" type="button"><i class="fa fa-angle-down"></i></button>
                                                        <ul role="menu" class="dropdown-menu pull-right">
                                                            <li><a href="javascript:void(0);" class="filter-cancel">重置</a></li>
                                                        </ul>
                                                    </div>
                                                </th>
                                            </tr>
                                            </thead>
                                            <tbody></tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>

                            <!--商品列表-->
                            <div class="tab-pane" id="tab_1_5">
                                <div class="table-actions-wrapper">
                                    <?php if (adminAuthority('merchant-product','member')):?>
                                        <a class="btn btn-sm blue" href="<?php echo getUrl('member/merchant/productForm?merchant_id='.$info['id'])?>"><i class="fa fa-plus"></i> 新增</a>
                                        <a class="btn btn-sm blue confirm"  attr="1" href="javascript:void(0)"><i class="fa fa-plus"></i> 批量上架</a>
                                        <a class="btn btn-sm red confirm"  attr="2" href="javascript:void(0)"><i class="fa fa-minus"></i> 批量下架</a>
                                    <?php endif;?>
                                </div>
                                <div class="table-responsive">
                                    <div class="table-container">
                                        <table class="table table-bordered table-hover" id="datatable_product">
                                            <thead>
                                            <tr role="row" class="heading">
                                                <th width="50px" class="table-checkbox">
                                                    <input type="checkbox" class="group-checkable" data-set="#sample_1 .checkboxes"/>
                                                </th>
                                                <th width="5%"> 图标 </th>
                                                <th width="20%"> 商品名称 </th>
                                                <th width="10%" sort="false">分类名称</th>
                                                <th width="10%" sort="false">库存类型</th>
                                                <th width="10%" sort="false">价格</th>
                                                <th width="6%" sort="false">销量</th>
                                                <th width="6%" sort="false">库存</th>
                                                <th width="10%" sort="false">创建时间</th>
                                                <th width="8%" sort="false">状态</th>
                                                <th width="15%" sort="false">操作</th>
                                            </tr>
                                            <tr>
                                                <th></th>
                                                <th></th>
                                                <th><input class="form-control form-filter input-sm" name="name" type="text"></th>
                                                <th>
                                                    <select name="custom_category_id" class="form-control form-filter input-sm">
                                                        <option value="0" selected="selected">所有</option>
                                                        <?php foreach ($custom as $ck =>$cv):?>
                                                            <option value="<?php echo $cv['id']?>"><?php echo $cv['cat_name']?></option>
                                                        <?php endforeach;?>
                                                    </select>
                                                </th>
                                                <th>
                                                    <select name="is_limited" class="form-control form-filter input-sm">
                                                        <option value="" selected="selected">所有</option>
                                                        <option value="2">无限</option>
                                                        <option value="1">有限</option>
                                                    </select>
                                                </th>
                                                <th>
                                                    <input class="form-control form-filter input-sm" name="goods_price" type="text" placeholder="价格"/>
                                                </th>
                                                <th></th>
                                                <th></th>
                                                <th>
                                                    <div class="margin-bottom-5">
                                                        <input class="form-control form-filter input-sm" name="pro_send_date_from" dp placeholder="大于等于" type="text">
                                                    </div>
                                                    <input class="form-control form-filter input-sm" name="pro_send_date_to" dp placeholder="小于等于" type="text">
                                                </th>
                                                <th>
                                                    <select name="pro_status" class="form-control form-filter input-sm">
                                                        <option value="0" selected="selected">所有</option>
                                                        <?php foreach ($proStatus as $k =>$v):?>
                                                            <option value="<?php echo $k+1?>"><?php echo $v?></option>
                                                        <?php endforeach;?>
                                                    </select>
                                                </th>
                                                <th>
                                                    <div class="btn-group">
                                                        <a class="btn btn-xs filter-submit btn-default"><i class="fa fa-search"></i> 搜索</a>
                                                        <button data-toggle="dropdown" class="btn btn-default dropdown-toggle btn-xs" type="button"><i class="fa fa-angle-down"></i></button>
                                                        <ul role="menu" class="dropdown-menu pull-right">
                                                            <li><a href="javascript:void(0);" class="filter-cancel">重置</a></li>
                                                        </ul>
                                                    </div>
                                                </th>
                                            </tr>
                                            </thead>
                                            <tbody></tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>

                            <!--商品分类-->
                            <div class="tab-pane" id="tab_1_6">
                                <div class="table-actions-wrapper"> <span> </span>
                                    <?php if (adminAuthority('merchant-category','member')):?>
                                    <a class="btn btn-sm blue category-add" href="javascript:"><i class="fa fa-plus"></i> 新增</a>
                                    <?php endif;?>
                                </div>
                                <div class="table-responsive">
                                    <div class="table-container">
                                        <table class="table table-bordered table-hover" id="datatable_category">
                                            <thead>
                                            <tr role="row" class="heading">
                                                <th width="5%"> ID</th>
                                                <th width="18%"> 一级分类</th>
                                                <th width="17%">二级分类</th>
                                                <th width="20%">分类名称</th>
                                                <th width="10%">状态</th>
                                                <th width="20%">添加时间</th>
                                                <th width="10%">操作</th>
                                            </tr>
                                            <tr>
                                                <th></th>
                                                <th><input class="form-control form-filter input-sm" name="parent_name" type="text"></th>
                                                <th><input class="form-control form-filter input-sm" name="category_name" type="text"></th>
                                                <th><input class="form-control form-filter input-sm" name="cat_name" type="text"></th>
                                                <th>
                                                    <select name="cat_status" class="form-control form-filter input-sm">
                                                        <option value="" selected="selected">所有</option>
                                                        <option value="1" >禁用</option>
                                                        <option value="2" >启用</option>
                                                    </select>
                                                </th>
                                                <th>
                                                    <input class="form-control form-filter input-sm fl" name="cat_send_date_from" dp placeholder="大于等于" type="text">
                                                    <input class="form-control form-filter input-sm fl" name="cat_send_date_to" dp placeholder="小于等于" type="text">
                                                </th>
                                                <th>
                                                    <div class="btn-group">
                                                        <a class="btn btn-xs filter-submit btn-default"><i class="fa fa-search"></i> 搜索</a>
                                                        <button data-toggle="dropdown" class="btn btn-default dropdown-toggle btn-xs" type="button"><i class="fa fa-angle-down"></i></button>
                                                        <ul role="menu" class="dropdown-menu pull-right">
                                                            <li><a href="javascript:void(0);" class="filter-cancel">重置</a></li>
                                                        </ul>
                                                    </div>
                                                </th>
                                            </tr>
                                            </thead>
                                            <tbody></tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>

                            <!--资金明细明细-->
                            <div class="tab-pane" id="tab_1_7">
                                <div class="table-actions-wrapper">
                                    <?php if (adminAuthority('merchant-found','member')):?>
                                    <a class="btn btn-sm blue add-found-btn" href="javascript:;" merchant_id = "<?php echo get('id')?>"><i class="fa fa-plus"></i> 资金调节</a>
                                    <?php endif;?>
                                </div>
                                <div class="table-responsive">
                                    <div class="table-container">
                                        <table class="table table-bordered table-hover" id="datatable_found">
                                            <thead>
                                            <tr role="row" class="heading">
                                                <th width="20%"> 类型</th>
                                                <th width="20%">金额</th>
                                                <th width="20%">状态</th>
                                                <th width="30%">时间</th>
                                                <th width="10%">操作</th>
                                            </tr>
                                            <tr>
                                                <th>
                                                    <select name="found_type" class="form-control form-filter input-sm">
                                                        <option value="" selected="selected">所有</option>
                                                        <?php  foreach ($found_type as $k=>$item):?>
                                                            <option value="<?php echo $k;?>" ><?php echo $item;?></option>
                                                        <?php endforeach;?>
                                                    </select>
                                                </th>
                                                <th></th>
                                                <th>
                                                    <select name="found_status" class="form-control form-filter input-sm">
                                                        <option value="" selected="selected">所有</option>
                                                        <?php  foreach ($found_status as $k=>$item):?>
                                                            <option value="<?php echo $k;?>" ><?php echo $item;?></option>
                                                        <?php endforeach;?>
                                                    </select>
                                                </th>
                                                <th>
                                                    <input class="form-control form-filter input-sm fl" name="addtime_from" dp placeholder="大于等于" type="text">
                                                    <input class="form-control form-filter input-sm fl" name="addtime_to" dp placeholder="小于等于" type="text">
                                                </th>
                                                <th> <div class="btn-group">
                                                        <a class="btn btn-xs filter-submit btn-default"><i class="fa fa-search"></i> 搜索</a>
                                                        <button data-toggle="dropdown" class="btn btn-default dropdown-toggle btn-xs" type="button"><i class="fa fa-angle-down"></i></button>
                                                        <ul role="menu" class="dropdown-menu pull-right">
                                                            <li><a href="javascript:void(0);" class="filter-cancel">重置</a></li>
                                                        </ul>
                                                    </div>
                                                </th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>

                            <!--红包投放-->
                            <div class="tab-pane" id="tab_1_8">
                                <div class="table-responsive">
                                    <div class="table-container">
                                        <table class="table table-bordered table-hover" id="datatable_bonus">
                                            <thead>
                                            <tr role="row" class="heading">
                                                <th width="10%"> 广告</th>
                                                <th width="30%"> 投放周期</th>
                                                <th width="10%"> 投放金额</th>
                                                <th width="10%"> 投放个数</th>
                                                <th width="10%"> 领取情况</th>
                                                <th width="10%"> 状态</th>
                                                <th width="10%"> 操作</th>
                                            </tr>
                                            <tr>
                                                <th></th>
                                                <th></th>
                                                <th></th>
                                                <th></th>
                                                <th></th>
                                                <th>
                                                    <select name="bonus_status" class="form-control form-filter input-sm">
                                                        <option value="" selected="selected">所有</option>
                                                        <option value="1">未开始</option>
                                                        <option value="2">已结束</option>
                                                        <option value="3">进行中</option>
                                                    </select>
                                                </th>
                                                <th>
                                                    <div class="btn-group">
                                                        <a class="btn btn-xs filter-submit btn-default"><i class="fa fa-search"></i> 搜索</a>
                                                        <button data-toggle="dropdown" class="btn btn-default dropdown-toggle btn-xs" type="button"><i class="fa fa-angle-down"></i></button>
                                                        <ul role="menu" class="dropdown-menu pull-right">
                                                            <li><a href="javascript:void(0);" class="filter-cancel">重置</a></li>
                                                        </ul>
                                                    </div>
                                                </th>
                                            </tr>
                                            </thead>
                                            <tbody></tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>

                            <!--代金劵投放-->
                            <div class="tab-pane" id="tab_1_9">
                                <div class="row ">
                                    <div class="col-md-12">
                                        <!-- BEGIN VALIDATION STATES-->
                                        <div class="portlet box">
                                            <div class="portlet-body form">
                                                <form action="<?php echo getUrl('member/merchant/saveCoupon');?>" class="form-horizontal" id="coupon-form" method="post">
                                                    <div class="modal-body">
                                                        <div class="form-group">
                                                            <label class="control-label col-md-2">优惠面额（元）<span class="required">*</span></label>
                                                            <div class="col-md-4">
                                                                <input class="form-control required number" name="money" type="text" value="<?php echo isset($cashInfo['money']) ? $cashInfo['money'] : '';?>" >
                                                                <span class="help-block">请发放面额小于100的优惠券</span>
                                                            </div>
                                                        </div>
                                                        <div class="form-group">
                                                            <label class="control-label col-md-2">有效时间（小时）<span class="required">*</span></label>
                                                            <div class="col-md-4">
                                                                <input class="form-control required number"  name="valid_hour" type="text" value="<?php echo isset($cashInfo['valid_hour']) ? $cashInfo['valid_hour'] : '';?>" >
                                                            </div>
                                                        </div>
                                                        <div class="form-group">
                                                            <label class="control-label col-md-2">获得条件<span class="required">*</span></label>
                                                            <div class="col-md-4">
                                                                <input class="form-control required number"  name="receive" type="text" value="<?php echo isset($cashInfo['receive']) ? $cashInfo['receive'] : '';?>" >
                                                                <span class="help-block">订单满 xx 元</span>
                                                            </div>
                                                        </div>
                                                        <div class="form-group">
                                                            <label class="control-label col-md-2">使用条件<span class="required">*</span></label>
                                                            <div class="col-md-4">
                                                                <input class="form-control required number"  name="condition" type="text" value="<?php echo isset($cashInfo['condition']) ? $cashInfo['condition'] : '';?>" >
                                                                <span class="help-block">订单满 xx 元</span>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="form-actionsc fluid">
                                                        <div class="col-md-offset-2 col-md-9" style="padding-left: 0;">
                                                            <input type="hidden" name="merchant_id" value="<?php echo get('id')?>">
                                                            <button class="btn green"><i class="fa fa-save"></i> 保存</button>
                                                            <a class="btn default seach-btn" href="<?php echo getUrl('member/merchant');?>"><i class="fa fa-chevron-left"></i> 返回</a>
                                                        </div>
                                                    </div>
                                                </form>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <!--满减规则-->
                            <div class="tab-pane" id="tab_1_10">
                                <div class="row ">
                                    <div class="col-md-12">
                                        <!-- BEGIN VALIDATION STATES-->
                                        <div class="portlet box">
                                            <div class="portlet-body form">
                                                <form action="<?php echo getUrl('member/merchant/saveFull');?>" class="form-horizontal" id="full-form" method="post">
                                                    <div class="modal-body">
                                                        <div class="form-group">
                                                            <label class="control-label col-md-2">起始时间<span class="required">*</span></label>
                                                            <div class="col-md-4">
                                                                <input class="form-control required" name="start_time" dp type="text" value="<?php echo isset($fullInfo['start_time']) ? $fullInfo['start_time'] : '';?>" >
                                                            </div>
                                                        </div>
                                                        <div class="form-group">
                                                            <label class="control-label col-md-2">结束时间<span class="required">*</span></label>
                                                            <div class="col-md-4">
                                                                <input class="form-control required"  name="end_time" dp type="text" value="<?php echo isset($fullInfo['end_time']) ? $fullInfo['end_time'] : '';?>" >
                                                            </div>
                                                        </div>
                                                        <?php for($i = 0; $i < 3; $i ++):?>
                                                            <div class="form-group">
                                                                <label class="control-label col-md-2">
                                                                    满减规则 <?php if ($i == 0){ echo '一'; }else if($i == 1){ echo '二'; }else{ echo '三'; }?>
                                                                    <span class="required">*</span></label>
                                                                <div class="col-md-2">
                                                                    <input type="text" class="form-control" name="rule[<?php echo $i?>][max_money]" value="<?php echo isset($fullInfo['rule'][$i]['max_money']) ? $fullInfo['rule'][$i]['max_money'] : '';?>">
                                                                    <span class="help-block">满 xx 减 xx 元</span>
                                                                </div>
                                                                <div class="col-md-2">
                                                                    <input type="text" class="form-control" name="rule[<?php echo $i?>][money]" value="<?php echo isset($fullInfo['rule'][$i]['money']) ? $fullInfo['rule'][$i]['money'] : '';?>">
                                                                    <span class="help-block">请设置面额小于100的满减金额</span>
                                                                </div>
                                                            </div>
                                                        <?php endfor;?>
                                                    </div>
                                                    <div class="form-actionsc fluid">
                                                        <div class="col-md-offset-2 col-md-9" style="padding-left: 0;">
                                                            <input type="hidden" name="merchant_id" value="<?php echo get('id')?>">
                                                            <button class="btn green"><i class="fa fa-save"></i> 保存</button>
                                                            <a class="btn default seach-btn" href="<?php echo getUrl('member/merchant');?>"><i class="fa fa-chevron-left"></i> 返回</a>
                                                        </div>
                                                    </div>
                                                </form>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <!--广告投放-->
                            <div class="tab-pane" id="tab_1_11">
                                <div class="table-responsive">
                                    <div class="table-container">
                                        <table class="table table-bordered table-hover" id="datatable_ads">
                                            <thead>
                                            <tr role="row" class="heading">
                                                <th width="25%"> 广告位 </th>
                                                <th width="20%"> 周期（天） </th>
                                                <th width="25%" sort="false">申请时间</th>
                                                <th width="20%" sort="false">状态</th>
                                                <th width="10%" sort="false">操作</th>
                                            </tr>
                                            <tr>
                                                <th>
                                                    <select name="ad_position" class="form-control form-filter input-sm">
                                                        <option value="" selected="selected">所有</option>
                                                        <?php foreach ($position as $posk => $posv):?>
                                                            <option value="<?php echo $posk?>"><?php echo $posv?></option>
                                                        <?php endforeach;?>
                                                    </select>
                                                </th>
                                                <th></th>
                                                <th>
                                                    <div class="margin-bottom-5">
                                                        <input class="form-control form-filter input-sm" name="ads_send_date_from" dp placeholder="从" type="text">
                                                    </div>
                                                    <input class="form-control form-filter input-sm" name="ads_send_date_to" dp placeholder="到" type="text">
                                                </th>
                                                <th>
                                                    <select name="ads_status" class="form-control form-filter input-sm">
                                                        <option value="" selected="selected">所有</option>
                                                        <?php foreach ($adsStatus as $adsk => $adsv):?>
                                                            <option value="<?php echo $adsk?>"><?php echo $adsv?></option>
                                                        <?php endforeach;?>
                                                    </select>
                                                </th>
                                                <th>
                                                    <div class="btn-group">
                                                        <a class="btn btn-xs filter-submit btn-default"><i class="fa fa-search"></i> 搜索</a>
                                                        <button data-toggle="dropdown" class="btn btn-default dropdown-toggle btn-xs" type="button"><i class="fa fa-angle-down"></i></button>
                                                        <ul role="menu" class="dropdown-menu pull-right">
                                                            <li><a href="javascript:void(0);" class="filter-cancel">重置</a></li>
                                                        </ul>
                                                    </div>
                                                </th>
                                            </tr>
                                            </thead>
                                            <tbody></tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>

                            <!--银行卡支付宝-->
                            <div class="tab-pane" id="tab_1_12">
                                <div class="table-responsive">
                                    <div class="table-container">
                                        <table class="table table-bordered table-hover" id="datatable_account">
                                            <thead>
                                            <tr role="row" class="heading">
                                                <th width="10%"> 类型</th>
                                                <th width="20%"> 开户名(支付宝用户名)</th>
                                                <th width="20%">银行卡号(支付宝账号)</th>
                                                <th width="20%">开户行( 支付宝)</th>
                                                <th width="20%">联系电话</th>
                                                <th width="10%">操作</th>
                                            </tr>
                                            <tr>
                                                <th>
                                                    <select name="bank_type" class="form-control form-filter input-sm">
                                                        <option value="" selected="selected">所有</option>
                                                        <option value="1">银行卡</option>
                                                        <option value="2">支付宝</option>
                                                    </select>
                                                </th>
                                                <th><input class="form-control form-filter input-sm" name="account_name" type="text"></th>
                                                <th><input class="form-control form-filter input-sm" name="account_number" type="text"></th>
                                                <th></th>
                                                <th><input class="form-control form-filter input-sm" name="mobile" type="text"></th>
                                                <th> <div class="btn-group">
                                                        <a class="btn btn-xs filter-submit btn-default">
                                                            <i class="fa fa-search"></i> 搜索
                                                        </a>
                                                        <button data-toggle="dropdown" class="btn btn-default dropdown-toggle btn-xs" type="button"><i class="fa fa-angle-down"></i></button>
                                                        <ul role="menu" class="dropdown-menu pull-right">
                                                            <li>
                                                                <a href="javascript:void(0);" class="filter-cancel">重置</a>
                                                            </li>
                                                        </ul>
                                                    </div></th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>

                            <!--监管部门-->
                            <div class="tab-pane" id="tab_1_13">
                                <div class="row ">
                                    <div class="col-md-12">
                                        <!-- BEGIN VALIDATION STATES-->
                                        <div class="portlet box">
                                            <div class="portlet-body form">
                                                <form action="<?php echo getUrl('member/merchant/saveShopImg')?>" class="form-horizontal" method="post" id="img-form" novalidate="novalidate">
                                                    <div class="form-body">
                                                        <div class="row ">
                                                            <div class="form-group">
                                                                <label class="control-label col-md-2">店铺环境<span class="required">*</span></label>
                                                                <div class="col-md-10">
                                                                    <div id="uploader-demo">
                                                                        <!--用来存放item-->
                                                                        <div class="uploader-list">
                                                                            <?php if(!empty($shopInfo['shop_imgs'])): foreach ($shopInfo['shop_imgs'] as $k => $v):?>
                                                                                <div id="" class="file-item thumbnail pic-list">
                                                                                    <img src="<?php echo $v; ?>">
                                                                                    <a title="删除" class="delete-btn hide" href="javascript:void(0);" style="color:#b94a48;position:absolute;top:-10px;right:-5px;background-color:#ffff;height:17px;width:15px;font-size:12px;padding:2px;">
                                                                                        <i class="fa fa-times"></i>
                                                                                    </a>
                                                                                    <input name="img[]" type="hidden" class="file-name" value="<?php echo $v; ?>">
                                                                                </div>
                                                                            <?php endforeach; endif;?>
                                                                            <div id="filePicker" class="file-item thumbnail webuploader-container">
                                                                                <div class="webuploader-pick">
                                                                                    <div style="position:absolute;top:0;left:0;width:100%;height:100%;padding-top:70px;color:grey;margin-top: 8px">选择图片</div>
                                                                                    <img title="选择上传图片" src="<?php echo getDefaultImg(); ?>">
                                                                                </div>
                                                                                <div id="rt_rt_1c2t7atu83351ra0bvm7gcgnu1" style="position: absolute; top: 4px; left: 4px; width: 100px; height: 100px; overflow: hidden; bottom: auto; right: auto;">
                                                                                    <input type="file" name="file" class="webuploader-element-invisible" multiple="multiple" accept="image/*">
                                                                                    <label style="opacity: 0; width: 100%; height: 100%; display: block; cursor: pointer; background: rgb(255, 255, 255);">
                                                                                    </label>
                                                                                </div>
                                                                            </div>
                                                                        </div>
                                                                        <script type="text/javascript">
                                                                            $(function(){
                                                                                uploadImg({
                                                                                    box:'#uploader-demo',
                                                                                    uploadBtn:"#filePicker",
                                                                                    fileName:'img[]',
                                                                                    width:110,  //显示缩略图宽带
                                                                                    uploadUrl:'<?php echo getUrl('member/merchant/uploadImgs');?>',
                                                                                    height:100	//显示缩略图高度
                                                                                });
                                                                            });
                                                                        </script>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="form-group">
                                                                <label class="control-label col-md-2">店铺广告<span class="required">*</span></label>
                                                                <div class="col-md-10">
                                                                    <div id="uploader-ads-demo">
                                                                        <!--用来存放item-->
                                                                        <div class="uploader-list">
                                                                            <?php if(!empty($shopInfo['shop_ads'])): foreach ($shopInfo['shop_ads'] as $k => $v):?>
                                                                                <div class="file-item pic-list">
                                                                                    <div id="" class="thumbnail ">
                                                                                        <img style="width: 100%;" src="<?php echo $v['adpic']; ?>">
                                                                                        <a title="删除" class="delete-btn hide" href="javascript:void(0);" style="color:#b94a48;position:absolute;top:-10px;right:-5px;background-color:#ffff;height:17px;width:15px;font-size:12px;padding:2px;">
                                                                                            <i class="fa fa-times"></i>
                                                                                        </a>
                                                                                        <input name="ads[]" type="hidden" class="file-name" value="<?php echo $v['adpic']; ?>">
                                                                                    </div>
                                                                                    <input name="productName" type="text" class="hide" value="<?php echo $v['productName']; ?>">
                                                                                    <input name="adpid[]" type="text" class="search-product" value="<?php echo $v['id']; ?>">
                                                                                </div>
                                                                            <?php endforeach; endif;?>
                                                                            <div id="fileAdsPicker" class="file-item thumbnail webuploader-container" style="margin-top: 3px">
                                                                                <div class="webuploader-pick">
                                                                                    <div style="position:absolute;top:0;left:0;width:100%;height:100%;padding-top:70px;color:grey;margin-top: 8px">选择图片</div>
                                                                                    <img style="width: 100%;" title="选择上传图片" src="<?php echo getDefaultImg(); ?>">
                                                                                </div>
                                                                                <div id="rt_rt_1c2t7atu83351ra0bvm7gcgnu2" style="position: absolute; top: 4px; left: 4px; width: 100px; height: 100px; overflow: hidden; bottom: auto; right: auto;">
                                                                                    <input type="file" name="file" class="webuploader-element-invisible" multiple="multiple" accept="image/*">
                                                                                    <label style="opacity: 0; width: 100%; height: 100%; display: block; cursor: pointer; background: rgb(255, 255, 255);">
                                                                                    </label>
                                                                                </div>
                                                                            </div>
                                                                        </div>
                                                                        <script type="text/javascript">
                                                                            $(function(){
                                                                                uploadImgForAd({
                                                                                    box:'#uploader-ads-demo',
                                                                                    uploadBtn:"#fileAdsPicker",
                                                                                    fileName:'ads[]',
                                                                                    width:110,  //显示缩略图宽带
                                                                                    uploadUrl:'<?php echo getUrl('member/merchant/uploadImgs');?>',
                                                                                    height:100	//显示缩略图高度
                                                                                    ,success:function () {
                                                                                        initialization(true);
                                                                                    }
                                                                                });
                                                                            });
                                                                        </script>
                                                                    </div>
                                                                </div>
                                                            </div>

                                                            <div class="form-actionsc fluid">
                                                                <div class="col-md-offset-2 col-md-9" style="padding-left: 0;">
                                                                    <input type="hidden" name="id" value="<?php echo get('id')?>">
                                                                    <button class="btn green"><i class="fa fa-save"></i> 保存</button>
                                                                    <a class="btn default seach-btn" href="<?php echo getUrl('member/merchant');?>"><i class="fa fa-chevron-left"></i> 返回</a>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </form>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <?php endif;?>

                            <?php if (!empty($shopInfo)):?>
                                <!--认证信息-->
                                <div <?php if ($shopInfo['status'] == 3): ?> class="active tab-pane" <?php else:?> class="tab-pane" <?php endif;?> id="tab_1_14">
                                    <div class="row">
                                        <form action="<?php echo getUrl('member/merchant/saveShop')?>" class="form-horizontal" method="post" id="shop-form" novalidate="novalidate">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-md-4 control-label text-label">店铺名称：</label>
                                                <div class="col-md-8 text-val"><?php echo $shopInfo['shop_name'];?></div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-md-4 control-label text-label">消费类型：</label>
                                                <div class="col-md-8 text-val">
<!--                                                    --><?php //echo $shopInfo['shop_type_name'];?>
                                                    <div class="checkbox-list">
                                                        <label class="checkbox-inline">
                                                            <input type="checkbox" id="inlineCheckbox21" <?php if ($shopInfo['shop_type'] == 1 || $shopInfo['shop_type'] == 3): ?> checked <?php endif;?> name="shop_type[]" value="1"> 送货上门 </label>
                                                        <label class="checkbox-inline">
                                                            <input type="checkbox" id="inlineCheckbox22" <?php if ($shopInfo['shop_type'] == 2 || $shopInfo['shop_type'] == 3): ?> checked <?php endif;?> name="shop_type[]" value="2"> 到店消费 </label>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-md-4 control-label text-label">区域：</label>
                                                <div class="col-md-8 text-val"><?php echo $shopInfo['province_name'].$shopInfo['city_name'].$shopInfo['county_name'];?></div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-md-4 control-label text-label">店铺地址：</label>
                                                <div class="col-md-8 text-val"><?php echo $shopInfo['address'].$shopInfo['street'];?></div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-md-4 control-label text-label">身份证名称：</label>
                                                <div class="col-md-8 text-val"><?php echo $shopInfo['id_name']?></div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-md-4 control-label text-label">身份证号码：</label>
                                                <div class="col-md-8 text-val"><?php echo $shopInfo['identification'];?></div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-md-4 control-label text-label">认证状态：</label>
                                                <div class="col-md-8 text-val"><?php echo $shopInfo['status_name'];?></div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-md-4 control-label text-label">认证时间：</label>
                                                <div class="col-md-8 text-val"><?php echo dateFormat($shopInfo['addtime']);?></div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-md-4 control-label text-label">营业执照：</label>
                                                <div class="col-md-8 text-val">
                                                    <img src="<?php echo $shopInfo['license']['og'];?>" style="width:257px;height: 200px;"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-md-4 control-label text-label">手持身份证照片：</label>
                                                <div class="col-md-8 text-val">
                                                    <?php if($shopInfo['other_documents']):?>
                                                    <img src="<?php echo $shopInfo['other_documents'][0];?>" style="width:257px;height: 200px;"/>
                                                    <?php endif;?>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-offset-2 col-md-8" style="margin-top: 20px;margin-bottom: 10px;">
                                            <?php if ($shopInfo['status'] == 3):?>
                                            <a href="<?php echo getUrl('member/merchant/shopStatus?status=2&id='.$shopInfo['merchant_id'])?>" class="ajax-request-btn btn blue-stripe default" alert-message="确定要通过“<?php echo $shopInfo['shop_name']?>”的认证?？">认证通过</a>
                                            <a href="javascript:;" class="btn red-stripe default refuse-btn" data-id="<?php echo $shopInfo['merchant_id']?>" data-name="<?php echo $shopInfo['shop_name']?>">认证拒绝</a>
                                            <?php endif;?>
                                            <input type="hidden" name="merchant_id" value="<?php echo get('id')?>">
                                            <button class="btn green"><i class="fa fa-save"></i> 保存</button>
                                        </div>
                                        </form>
                                    </div>
                            </div>
                            <?php endif;?>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<?php get_instance()->view('member/merchant/found_form'); // 资金明细?>
<?php //get_instance()->view('member/merchant/bonus_form'); // 编辑红包?>
<?php get_instance()->view('member/merchant/category_form'); // 商品分类?>
<?php //get_instance()->view('member/merchant/supervise_form'); /// 监管信息?>
<?php get_instance()->view('member/merchant/reason_form.php'); // 升级原因?>
<?php get_instance()->view('member/merchant/add_reason_form.php'); // 添加升级原因?>

<?php //get_instance()->view('config/ads_refuse_form.php'); // 广告申请 - 拒绝?>

<?php get_instance()->view('product/comment/img_form.php'); // 查看评价图片?>
<?php get_instance()->view('product/comment/reply_form.php'); // 评价回复?>
<?php get_instance()->view('member/merchant/refuse_form.php'); // 拒绝认证?>
<!-- 确认信息弹框 start-->
<div id="model-modal-msg" style="top: 20%;" class="modal fade modal_small hide" role="dialog" aria-labelledby="myModalLabel1" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                <h4 class="modal-title">确认信息</h4>
            </div>
            <form action="#" class="form-horizontal" id="model-form" method="post">
                <div class="modal-body">
                    <p id="model-msg"></p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn green save" id=""><i class="fa fa-save " ></i> 确定</button>
                </div>
            </form>
        </div>
    </div>
</div>
<script type="text/javascript">
    var id = <?php echo $info['id'];?>;
    $(function(){

        initialization();
        var model = $('#model-modal');
        $('.select2-container').each(function (i,e) {
            var productName = $(e).prev().val();
            if(productName=='')productName = '请选择商品';
            $(e).find('.select2-chosen').text(productName).parent('a').removeClass('select2-default');
        })
        $('.confirm').click(function(){
            var id =$(".productBox:checked");
            var type = $(this).attr('attr');
            if(id.length == 0){
                show_message({status:0, message:'请选择商品'});
                return false;
            }
            var type_str = '上架';
            var botton = 'batchPlus';
            if(type == 2){
                type_str = '下架';
                botton = 'batchMinus';
            }
            var message = '确认将'+id.length+'件商品'+type_str;

            $('.save').attr('id', botton);
            $('#model-msg').text(message);
            $('#model-modal-msg').removeClass('hide');
            $('#model-modal-msg').modal();
        });

        $("#batchPlus").live("click",function(){

            var id =$(".productBox:checked");
            if(id.length == 0){
                show_message({status:0, message:'请选择商品'});
                return false;
            }
            var ids = [];
            id.each(function(){
                ids.push($(this).val())
            });
            var index = layer.load(1, {
                shade: [0.1,'#fff']
            });
            $.post("<?php echo getUrl('product/home/bitchChangeStatus') ?>",{ids:ids.join(','),status:2},function (res) {
                $('#datatable_product').dataTable().fnDraw();
                layer.closeAll();
                $('#model-modal-msg').addClass('hide');
                window.location.reload();
            },'json')
        })

        $("#batchMinus").live("click",function(){

            var id =$(".productBox:checked");
            if(id.length == 0){
                show_message({status:0, message:'请选择商品'});
                return false;
            }
            var ids = [];
            id.each(function(){
                ids.push($(this).val())
            });
            var index = layer.load(1, {
                shade: [0.1,'#fff']
            });
            $.post("<?php echo getUrl('product/home/bitchChangeStatus') ?>",{ids:ids.join(','),status:1},function (res) {
                $('#datatable_product').dataTable().fnDraw();
                layer.closeAll();
                $('#model-modal-msg').addClass('hide');
                window.location.reload();

            },'json')
        })

        datatable_init({
            "sDom": "<'row'<'col-md-5 col-sm-12'<'table-group-actions pull-right'>>r><'table-scrollable't><'row'<'col-md-8 col-sm-12'pli><'col-md-4 col-sm-12'>r>>",
            src: $("#datatable_account"),
            sAjaxSource: "<?php echo getUrl('member/merchant/bankCardList?merchant_id=');?>"+id,
            bSort:false
        });

        // 订单列表
        datatable_init({
            "sDom": "<'row'<'col-md-5 col-sm-12'<'table-group-actions pull-right'>>r><'table-scrollable't><'row'<'col-md-8 col-sm-12'pli><'col-md-4 col-sm-12'>r>>",
            src: $("#datatable_order"),
            sAjaxSource: "<?php echo getUrl('member/merchant/orderList?merchant_id=');?>"+id,
            aoColumnDefs : [{
                'bSortable' : false,
                'aTargets' : [ 0,1,2,5,7,8]
            }]
        });

        // 订单售后
        datatable_init({
            "sDom": "<'row'<'col-md-5 col-sm-12'<'table-group-actions pull-right'>>r><'table-scrollable't><'row'<'col-md-8 col-sm-12'pli><'col-md-4 col-sm-12'>r>>",
            src: $("#datatable_service"),
            sAjaxSource: "<?php echo getUrl('member/merchant/serviceList?merchant_id=');?>"+id,
            aoColumnDefs : [{
                'bSortable' : false,
                'aTargets' : [ 0,1,2,3,6,7]
            }]
        });

        // 评价列表
        datatable_init({
            "sDom": "<'row'<'col-md-5 col-sm-12'<'table-group-actions pull-right'>>r><'table-scrollable't><'row'<'col-md-8 col-sm-12'pli><'col-md-4 col-sm-12'>r>>",
            src: $("#datatable"),
            sAjaxSource: "<?php echo getUrl('member/merchant/getCommentList?merchant_id=');?>"+id,
            aoColumnDefs : [{
                'bSortable' : false,
                'aTargets' : [ 0,1,3,4,5,7]
            }]
        });

        datatable_init({
            "sDom": "<'row'<'col-md-5 col-sm-12'<'table-group-actions pull-right'>>r><'table-scrollable't><'row'<'col-md-8 col-sm-12'pli><'col-md-4 col-sm-12'>r>>",
            src: $("#datatable_found"),
            sAjaxSource: "<?php echo getUrl('member/merchant/FoundLogList?merchant_id=');?>"+id,
            aoColumnDefs : [{
                'bSortable' : false,
                'aTargets' : [ 0,2,4]
            }]
        });

        // 红包投放
//        datatable_init({
//            "sDom": "<'row'<'col-md-5 col-sm-12'<'table-group-actions pull-right'>>r><'table-scrollable't><'row'<'col-md-8 col-sm-12'pli><'col-md-4 col-sm-12'>r>>",
//            src: $("#datatable_bonus"),
//            sAjaxSource: "<?php //echo getUrl('member/merchant/bonusList?merchant_id=');?>//"+id,
//            aoColumnDefs : [{
//                'bSortable' : false,
//                'aTargets' : [ 0,1,5,6]
//            }]
//        });

        //代金券投放
        datatable_init({
            "sDom": "<'row'<'col-md-5 col-sm-12'<'table-group-actions pull-right'>>r><'table-scrollable't><'row'<'col-md-8 col-sm-12'pli><'col-md-4 col-sm-12'>r>>",
            src: $("#datatable_cash_coupon"),
            sAjaxSource: "<?php echo getUrl('member/merchant/getCashCouponList?id=');?>"+id,
            aoColumnDefs : [{
                'bSortable' : false,
                'aTargets' : [5]
            }]
        });

        //商品分类
        datatable_init({
            "sDom": "<'row'<'col-md-5 col-sm-12'<'table-group-actions pull-right'>>r><'table-scrollable't><'row'<'col-md-8 col-sm-12'pli><'col-md-4 col-sm-12'>r>>",
            src: $("#datatable_category"),
            sAjaxSource: "<?php echo getUrl('member/merchant/getCategoryList?id=');?>"+id,
            aoColumnDefs : [{
                'bSortable' : false,
                'aTargets' : [ 0,1,2,3,4,6]
            }]
        });

        //商品列表
        datatable_init({
            "sDom": "<'row'<'col-md-5 col-sm-12'<'table-group-actions pull-right'>>r><'table-scrollable't><'row'<'col-md-8 col-sm-12'pli><'col-md-4 col-sm-12'>r>>",
            src: $("#datatable_product"),
            sAjaxSource: "<?php echo getUrl('member/merchant/getProductList?merchant_id=');?>"+id,
            aoColumnDefs : [{
                'bSortable' : false,
                'aTargets' : [ 0,1,2,3,4,8,9]
            }]
        });

        // 广告投放
//        datatable_init({
//            "sDom": "<'row'<'col-md-5 col-sm-12'<'table-group-actions pull-right'>>r><'table-scrollable't><'row'<'col-md-8 col-sm-12'pli><'col-md-4 col-sm-12'>r>>",
//            src: $("#datatable_ads"),
//            sAjaxSource: "<?php //echo getUrl('member/merchant/getAdsList?merchant_id=');?>//"+id,
//            aoColumnDefs : [{
//                'bSortable' : false,
//                'aTargets' : [ 0,3,4]
//            }]
//        });

        $('[dp]').not("[noinit]").datepicker({
            changeMonth: true,
            autoclose: true,
            format: "yyyy-mm-dd",
            language: 'zh-CN'
        });
        $.e_validate.init('#main-form', {});
        $.e_validate.init('#main-form2', {});
        $.e_validate.init('#coupon-form', {});
        $.e_validate.init('#full-form', {});
        $.e_validate.init('#shop-form', {});
        $.e_validate.init('#img-form', {});


        $('.content').live('mouseover',function(){
            $(this).height('75px');
        });

        $('.content').live('mouseout',function(){
            $(this).height('26px');
        });
    });

    function initialization(lasted) {

        var option = {
            closeOnSelect: true,
            placeholder: '选择链接商品',
            minimumInputLength: 2,
            ajax: {
                url: "<?php echo getUrl('common/searchProductByKeyword?merchant_id=')?>"+id,
                dataType: 'json',
                data: function (term, page) {
                    return {
                        keyword: term,
                    };
                },
                results: function (data, page) {
                    return {
                        results: data
                    };
                }
            },
            formatResult: function(movie) {
                return movie.name;
            },
            formatSelection: function(movie) {
                return movie.name;
            },
            dropdownCssClass: "bigdrop",
            escapeMarkup: function (m) {
                return m;
            }
        }
        if(lasted==true){
            $('.search-product:last').select2(option);
        }else {
            $('.search-product').select2(option);
        }
    }

    //异步调用
    function ajaxRequestCallBack(e){
        if(e.data == 'product'){
            $('#datatable_product').dataTable().fnDraw(true); // 商品列表上下架
        }else if(e.data == 'bonus'){
            $('#datatable_bonus').dataTable().fnDraw(true); // 红包
        }else if(e.data == 'supervise'){
            getDistrictList();   //监管信息
        }else if(e.data == 'order'){
            $("#datatable_order").dataTable().fnDraw(); // 订单列表
        }else if(e.data == 'shopSuccess'){
            history.go(0);
        }else{
            $('#datatable_category').dataTable().fnDraw(true);  // 商品分类
        }
    }
</script>
</body>
</html>